package r21118d1119nw;

import java.util.Locale;

public class Car {
    String fdjnumber;
    String cpnumber;

    public Car() {
    }

    public Car(String fdjnumber, String cpnumber) {
        this.fdjnumber = fdjnumber;
        this.cpnumber = cpnumber;
    }

    public String getFdjnumber() {
        return fdjnumber;
    }

    public void setFdjnumber(String fdjnumber) {
        this.fdjnumber = fdjnumber;
    }

    public String getCpnumber() {
        return cpnumber;
    }

    public void setCpnumber(String cpnumber) {
        this.cpnumber = cpnumber;
    }
    @Override
    public boolean equals(Object obj) {
//        return (this == obj);
        Car c =(Car) obj;
        if(this.cpnumber.equals(c.cpnumber) && this.fdjnumber.equals(c.fdjnumber)){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public String toString() {
        return this.fdjnumber+this.cpnumber;
    }

    public static void main(String[] args) {
        Car c1 = new Car("123456","321654");
        Car c2 = new Car("555555","666666");
        System.out.println(c1.equals(c2));
        System.out.println(c1.toString());
    }
}
